<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<!DOCTYPE html>

<html>
<head>
    <%@include file="/WEB-INF/views/layout/miiteen/base.ref.jsp" %>
</head>
<body>
<div class="mainpage view">
    <!--顶部菜单-->
    <div class="page-topmenu">
        <div class="btn-panel">
            <el-button size="small" icon="el-icon-back" @click="back">返回</el-button>
        </div>
    </div>
    <el-form :ref="formid" :model="form" :rules="rules" size="small" :label-width="labelwidth"
             :label-position="labelposition"
             class="one-col" :validate-on-rule-change="false">

        <!--视业务进行更改-begin-->
        <input type="hidden" v-model="form.id"/>
        <el-form-item label="类型" prop="type">
            <el-input v-model="form.type" placeholder="类型"></el-input>
        </el-form-item>
        <el-form-item label="导航名称" prop="navigation">
            <el-input v-model="form.navigation" placeholder="导航名称"></el-input>
        </el-form-item>
        <el-form-item label="图片" prop="icon">
            <el-upload
                    class="upload-demo"
                    action="/uploadfile/upload"
                    list-type="picture-card"
                    :before-upload="beforeUpload"
                    :on-preview="handlePreview"
                    :on-remove="handleRemove"
                    :on-success="handleSuccess"
                    :on-exceed="handleExceed"
                    :limit="1"
                    :file-list="dialogImageUrl"
            >
                <i class="el-icon-plus"></i>
                <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
            </el-dialog>
        </el-form-item>
        <el-form-item label="导航地址" prop="url">
            <el-input v-model="form.url" placeholder="导航地址"></el-input>
        </el-form-item>
        <el-form-item label="父级导航" prop="parent">
            <el-input v-model="form.parent" placeholder="父级导航"></el-input>
        </el-form-item>
        <el-form-item label="是否显示" prop="isDisplay">
            <el-radio-group v-model="form.isDisplay">
                <el-radio :label="1">是</el-radio>
                <el-radio :label="2">否</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="部门" prop="deptName">
            <el-input v-model="form.deptName" placeholder="部门" @focus="selectDept"></el-input>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
            <el-input v-model="form.remark" placeholder="备注"></el-input>
        </el-form-item>
    </el-form>
</div>
<script>
    //初始化数据，必须放置在列表页面封装部分前
    function initVueOption(obj) {
        //设置控制器
        obj.data.controller = "${ctx}/basic/basicnavigation";
        //设置表单数据
        obj.data.form = ${BasicNavigation};

        obj.data.dialogImageUrl = [];
        //图片回显
        if(obj.data.form.icon!=null){
            var image={name:"1",url:obj.data.form.icon}
            obj.data.dialogImageUrl.push(image);
        }
    }
</script>
<!--查看页面封装部分-->
<%@include file="/WEB-INF/views/layout/miiteen/page.view.ref.jsp" %>
</body>
</html>
